

/* 显示第几页 */
function showPage(current, pages) {
    console.log("---call showPage - " + current);
    if(current >= 1 || current <= pages){
        /* 合法的页面值，开始封装查询条件 */
        var queryBean = {};
        queryBean.groupNr = $('#dev_group_select').val();
        if($("input[name = 'devNr']").val() !== ''){
            queryBean.devNr = $("input[name = 'devNr']").val();
        }
        if($("input[name = 'devNrEnd']").val() !== ''){
            queryBean.devNrEnd = $("input[name = 'devNrEnd']").val();
        }
        if($("input[name = 'name']").val() !== ''){
            queryBean.name = $("input[name = 'name']").val();
        }
        if($("input[name = 'sysVersion']").val() !== ''){
            queryBean.sysVersion = $("input[name = 'sysVersion']").val();
        }
        if($("input[name = 'mac']").val() !== ''){
            queryBean.mac = $("input[name = 'mac']").val();
        }
        if($("input[name = 'intranetIp']").val() !== ''){
            queryBean.intranetIp = $("input[name = 'intranetIp']").val();
        }
        if($("input[name = 'extranetIp']").val() !== ''){
            queryBean.extranetIp = $("input[name = 'extranetIp']").val();
        }
        /* 发起调用 */
        deviceManView(current, queryBean);
    }
}

/* 删除一条设备信息 */
function deviceRemove(id) {
    console.log("---call deviceRemove");
    // 询问用户确认
    var b = confirm("数据无价，你想好了？");
    if(b){
        /* 发起调用 */
        call(null, source, TYPE_REMOVE, YS_VIEW, id + "", DEVICE_TASK, token);
    }
    return false;
}

/* 设备分组查看改变 */
function devGroupChange() {
    console.log("---call devGroupChange - ");
    var queryBean = {};
    queryBean.groupNr = $('#dev_group_select').val();
    console.log(queryBean.groupNr);
    /* 发起调用 */
    deviceManView(1, queryBean);
}

/* 将结果导出到Execl文件中 */
function exportExcelFile(current, pages) {
    console.log("---call exportExcelFile");
    // 询问用户确认
    var b = confirm("是否导出本页结果并下载Excel表格文件？");
    if(b){
        /* 发起调用 */
        call(null, source, TYPE_DOWNLOAD, YS_VIEW, "", DEVICE_TASK, token);
    }

    return false;
}


